package com.yeyks.model.enums;

/**
 * @Author fuchangshuai
 * @date 2019/3/7 6:39 PM
 */
public enum PayTypeEnum {

    WXPAY(0, "wxpay"),
    ALIPAY(1, "alipay"),
    UNITE(2, "unite"),
    JSAPI(3, "jsapi"),
    XCX(4, "xcx"),
    GZH(5, "gzh");

    int value;
    String desc;

    PayTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDescByValue(Integer value) {
        if (value == null) {
            return null;
        }
        if (value.equals(PayTypeEnum.XCX.value())) {
            return PayTypeEnum.XCX.desc();
        }
        if (value.equals(PayTypeEnum.GZH.value())) {
            return PayTypeEnum.GZH.desc();
        }
        if (value.equals(PayTypeEnum.WXPAY.value())) {
            return PayTypeEnum.WXPAY.desc();
        }
        if (value.equals(PayTypeEnum.ALIPAY.value())) {
            return PayTypeEnum.ALIPAY.desc();
        }
        if (value.equals(PayTypeEnum.UNITE.value())) {
            return PayTypeEnum.UNITE.desc();
        }
        if (value.equals(PayTypeEnum.JSAPI.value())) {
            return PayTypeEnum.JSAPI.desc();
        }
        return null;
    }
}
